package com.sskj.qiangjin.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.qiangjin.bean.LinkBean;
import com.sskj.qiangjin.http.HttpConfig;
import com.sskj.qiangjin.ui.activity.SpreadActivity;


public class SpreadActivityPresenter extends BasePresenter<SpreadActivity> {
    /**
     * 推广二维码地址/推广地址
     */
    public void getLinkData() {
        httpService.getLinkData()
                .tag(this)
                .execute(new JsonCallBack<HttpData<LinkBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<LinkBean>> response) {
                        HttpData httpData = response.body();
//                        ToastUtil.showShort(httpData.msg);
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updataUI((LinkBean) httpData.getData());
                        }
                    }
                });
    }

}
